home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _9FFFBDE205EA410CB2CF6624D4891893 < prev    next >
Text File  |  2004-11-14  |  702b  |  38 lines

  1. //rain cylendar pixel shader:
  2. //mixes color of 2 layers of rain linearly
  3. //Luke Lenhart
  4. //(C)2004-2005 Digipen Institute of Technology
  5.  
  6. //blend factor between 2 layers
  7. float blend;
  8.  
  9. //layer 0 sampler
  10. sampler2D sampRain0;
  11.  
  12. //layer 1 sampler
  13. sampler2D sampRain1;
  14.  
  15. //shader input
  16. struct PS_INPUT
  17. {
  18.     float4 Color : COLOR;
  19.     float2 Tex0 : TEXCOORD0;
  20. };
  21.  
  22. //shader code
  23. float4 PShader(PS_INPUT In) : COLOR
  24. {
  25.    //sample textutes
  26.    float4 rain0=tex2D(sampRain0,In.Tex0);
  27.    float4 rain1=tex2D(sampRain1,In.Tex0);
  28.  
  29.    //simple blend of samples
  30.    float4 clr=lerp(rain0,rain1,blend);
  31.    
  32.    //apply vert color
  33.    clr*=In.Color;
  34.    
  35.    //spit out color
  36.    return clr;
  37. }
  38.